package com.ctgu.demo.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ctgu.demo.entity.Cake;
import com.ctgu.demo.service.CakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: CakeController
 * @description:
 * @author: gh
 * @create: 2020-06-22 12:24
 **/
@CrossOrigin(allowCredentials = "true", allowedHeaders = "*")
@RestController
@RequestMapping("/cake")
public class CakeController {

    @Autowired
    CakeService cakeService;

    @RequestMapping("/getCakeAll")
    public List<Cake> getCakeAll(){
        QueryWrapper<Cake> wrapper =new QueryWrapper<Cake>();
        wrapper.select("*");
        List<Cake> list= cakeService.list(wrapper);
        return list;
    }
}
